/*
 * input_handler.h
 *
 *  Created on: 30-May-2009
 *      Author: christian
 */

#ifndef INPUT_HANDLER_H_
#define INPUT_HANDLER_H_

#include <stdio.h>
#include <vector>
#include "object.h"

struct object_
{
	std::string id;
	cta::object* obj;
};
struct command_
{
	std::string command;
	std::string id;
	uint32 key; /*utf32_char*/
};

namespace cta {

class input_handler {
private:
	// Objects
	std::vector<object_> obj;
	std::vector<command_> cmd;

public:
	input_handler();
	bool init_commands(std::string FileName, std::string state);
	bool add_object(object* obj_);
	bool handle();
	bool ReadConfigFromFile(std::string FileName, std::string state);
	bool End();
	virtual ~input_handler();
	static input_handler& ih() {
		static input_handler singleton;
		return singleton;
	}
};

}

#endif /* INPUT_HANDLER_H_ */
